<template>
  <div class="about">
    <span>{{phoneNumber}},{{userId}}</span>
    <button @click="LogInState">清除</button>
    <button @click.stop="refsh">刷新当前组件</button>
    <button @click="loadingShow">显示遮罩</button>
    <button @click="webview">webview</button>
  </div>
</template>
<script>
  import {mapGetters, mapActions} from 'vuex';

  export default {
    name: 'about',
    inject: ['reload', 'loadingFun'],
    data() {
      return {}
    },
    computed: {
      ...mapGetters(['userId', 'phoneNumber'])
    },
    created() {
      console.log("刷新当前组件");
      this.LogOutState();
    },
    methods: {
      ...mapActions(['LogInState', 'LogOutState']),
      refsh() {
        this.reload();
      },
      loadingShow() {
        const that = this;
        this.loadingFun(true);
        setTimeout(function () {
          that.loadingFun(false);
        }, 5000)
      },
      webview() {
        var url='https://cn.vuejs.org/v2/guide/transitions.html';
        this.$router.push({'path':'/webview',query:{'url':url}})
      }
    }
  }
</script>
